<template>
	<div class="user">
		<!-- 导航区 -->
		<div class="menu">
			<div class="sticky">
				<div class="header">
					<el-icon class="el-icon"><House /></el-icon>
					<span>/ 会员中心</span>
				</div>
				<el-menu :default-active="route.path">
					<el-menu-item index="/user/certification" @click="go">
						<el-icon><Postcard /></el-icon>
						<span>实名认证</span>
					</el-menu-item>
					<el-menu-item index="/user/order" @click="go">
						<el-icon><Memo /></el-icon>
						<span>挂号订单</span>
					</el-menu-item>
					<el-menu-item index="/user/patient" @click="go">
						<el-icon><User /></el-icon>
						<span>就诊人管理</span>
					</el-menu-item>
					<el-menu-item index="/user/profile" @click="go">
						<el-icon><Document /></el-icon>
						<span>账号管理</span>
					</el-menu-item>
					<el-menu-item index="/user/feedback" @click="go">
						<el-icon><ChatDotRound /></el-icon>
						<span>意见反馈</span>
					</el-menu-item>
				</el-menu>
			</div>
		</div>
		<!-- 展示区 -->
		<div class="content">
			<router-view></router-view>
		</div>
	</div>
</template>

<script setup lang="ts">
import { House, Document, Postcard, Memo, User, ChatDotRound } from '@element-plus/icons-vue';
import { useRoute, useRouter } from 'vue-router';

const route = useRoute();
const router = useRouter();

function go(obj: any) {
	router.push({
		path: obj.index,
	});
}
</script>

<style scoped lang="scss">
.user {
	display: flex;
	.menu {
		flex: 2;
		.sticky {
			position: sticky;
			top: 80px;
			.header {
				color: #aaa;
				font-size: 14px;
				padding-left: 22px;
				margin-bottom: 10px;
				display: flex;
				align-items: center;

				.el-icon {
					margin-right: 4px;
				}
			}
			:deep(.el-menu) {
				width: 180px;
			}
		}
	}
	.content {
		flex: 8;
	}
}
</style>
